What is a links file? See below:
You may already have seen the yellow icon with a red arrow if you are familiar with FTP (some FTP clients do not show this arrow but only the 'l' under file attributes) and wondered how it was done. In fact, this is one of the easiest things to do but sometimes obscure for beginners.
What do we need?
That's it! For example, imagine that you would allow access to your CD-Rom drive 'G:\' for a user named 'Demo'.
- a directory/Cdrom drive/harddrive to share
- access to this directory for the concerned user
- 'Notepad.exe' (or any other text editor) to edit the link file
Finished! Now the user will see a shortcut to 'G:\' named 'My Secret Files'; a click on it redirects him to 'G:\'. Was it that difficult? Well, for those of you who want more options, here are some extra tips: when you want a user to have a shortcut to his Home Directory create a link with an '~' as the path (note: the tilde-symbol '~' can be reached via ALT + 126 on your numpad). So this user will have 2 links:
- the first thing to do is to give the user access to 'G:\'
- create a new file with Notepad: we will call it 'Demo_links.txt'
- add an alias called 'My Secret Files' to 'G:\' in the 'Demo_links.txt' so the content of the file reads:
My Secret Files | G:\(Note: if you can't find the pipe-symbol '|' on your keyboard hold down ALT and enter 124 on the numpad!)
- save the file in a directory of your choice (not in a shared directory since other users could access the links file and thus resources they were not meant to use!) and set a path to this file under 'Add links from this file' of the user's account.
- uncheck 'Show relative paths' under Main Setup | Options and (if already set) under User/Group Accounts | Miscellaneous | Files (note: 'Show Relative Paths' can be used for Virtual Directories as explained below)
My Secret Files | G:\ To Home Directory | ~To have your links listed first, I suggest you to put a '+' (or any other letter with a higher priority than 'a') as the first letter:
+My Secret Files | G:\ +To Home Directory | ~Now these links will be atop of the directory list. This can also be done for a group account so that all members have the same links. Simply set the 'Add links from this file' in the group account instead of the user account (don't forget to give the group access to the shared directory).Note:
Once you understood how to handle these files you can start creating some Virtual Directories.
- links pointing to invalid (non existent) directories are not shown
- links pointing to themselves are not shown (if a user is in the directory pointed to by the link)
- links are shown in all user's directories (this may change in future versions of BPFTP)
Enhanced links: Virtual Directories (VDs)
Think of this:
Solution: create a link file as you did above and add an alias, for example:
- you run an FTP Site with BPFTP and you specify that clients shall see relative paths instead of full paths
- a user can access his home directory by entering: ftp://user:pass@192.168.0.1/ in their web browser
- you also want users to have access to: ftp://user:pass@192.168.0.1/My Lastest Photos/ but this dir is located on another drive or does not even exist on your server (however, it's NOT in the user's root path and thus usually not accessible for him)
My Latest Photos | G:\Do not forget to give at least read access to this drive. Having done that, 'My Latest Photos' can be accessed by users typing ftp://user:pass@192.168.0.1/My Latest Photos/ without you having to copy this directory into the user's home directory. The difference between links and VDs is that clients are not simply redirected but VDs 'simulate' the real directories. A directory that is physically elsewhere (on another drive or even a network resource) is 'mapped' into the user's home directory.To reiterate:
Now you enable 'Treat links file as Virtual Directory' and also select the links file from above. Now the user will see 'My Latest Photos' as a VD in his home directory even though this directory is not physically placed in 'c:\ftproot\'. Now the user can click on 'My Latest Photos' and his path becomes '/My Latest Photos'. The contents of this directory come from 'G:\'.
User 'Demo' has access to 'c:\ftproot' which is his home directory. When he logs in the only things he can see is this directory (listed as '/' since 'Show Relative Path' is enabled) and it's contents (the directory 'drivers' and 2 files).Note:
- You can mount as many VDs as you like in your home directory
- IMO this is a more aesthetic way to link directories
- do never forget that you still have to give access to the target path of the VD otherwise it won't even be seen by the user!